{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/fcoell/Dropbox/PATSTAT/DATA/../logs/Appendix_Fig7_Table9.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}22 Jun 2020, 11:30:58
{txt}
{com}. di "********************* Appendix Figure 7 and Table 9 **********************"
{res}********************* Appendix Figure 7 and Table 9 **********************
{txt}
{com}. * Share of imports
. capture drop tmp ww wwT
{txt}
{com}. egen tmp = sum(p), by(appln y)
{txt}
{com}. gen ww = p/tmp
{txt}(1,133,834 missing values generated)

{com}. capture drop tmp
{txt}
{com}. egen tmp = sum(flow), by(appln y) 
{txt}
{com}. gen wwT = flow/tmp
{txt}(43,406 missing values generated)

{com}. label var ww "Import share, patents" 
{txt}
{com}. label var wwT "Import share, trade"
{txt}
{com}. scatter ww wwT if appln=="US" & y==2000 & ww>.00001 & wwT>.00001, mlabel(headq) yscale(log) xscale(log) scheme(lean1) xlab(.0001 .001 .01 .1 1) ylab(.0001 .001 .01 .1 1) name(b1, replace) subtitle("US")
{res}{txt}
{com}. scatter ww wwT if appln=="DE" & y==2000 & ww>.00001 & wwT>.00001, mlabel(headq) yscale(log) xscale(log) scheme(lean1) xlab(.0001 .001 .01 .1 1) ylab(.0001 .001 .01 .1 1) name(b2, replace) subtitle("Germany")
{res}{txt}
{com}. scatter ww wwT if appln=="JP" & y==2000 & ww>.00001 & wwT>.00001, mlabel(headq) yscale(log) xscale(log) scheme(lean1) xlab(.0001 .001 .01 .1 1) ylab(.0001 .001 .01 .1 1) name(b3, replace) subtitle("Japan")
{res}{txt}
{com}. scatter ww wwT if appln=="GB" & y==2000 & ww>.00001 & wwT>.00001, mlabel(headq) yscale(log) xscale(log) scheme(lean1) xlab(.0001 .001 .01 .1 1) ylab(.0001 .001 .01 .1 1) name(b4, replace) subtitle("Great Britain")
{res}{txt}
{com}. gr combine b1 b2 b3 b4, scheme(lean1)
{res}{txt}
{com}. graph export "../graph/import_shares_patents_trade.eps", as(eps) preview(on) replace
{txt}(file ../graph/import_shares_patents_trade.eps written in EPS format)

{com}. graph save "../graph/import_shares_patents_trade.gph", replace
{res}{txt}(file ../graph/import_shares_patents_trade.gph saved)

{com}. 
. * Regressions
. egen id = group(appln_auth headq)
{txt}
{com}. 
. reg lnP lndist lngdpo lngdpd if y==2000, vce(robust)

{txt}Linear regression                               Number of obs     = {res}     2,558
                                                {txt}F(3, 2554)        =  {res}   472.47
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.4263
                                                {txt}Root MSE          =    {res} 1.6455

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}         lnP{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}lndist {c |}{col 14}{res}{space 2}-.4393655{col 26}{space 2} .0324752{col 37}{space 1}  -13.53{col 46}{space 3}0.000{col 54}{space 4}-.5030459{col 67}{space 3}-.3756851
{txt}{space 6}lngdpo {c |}{col 14}{res}{space 2} .6771869{col 26}{space 2} .0193971{col 37}{space 1}   34.91{col 46}{space 3}0.000{col 54}{space 4} .6391514{col 67}{space 3} .7152225
{txt}{space 6}lngdpd {c |}{col 14}{res}{space 2} .5035256{col 26}{space 2} .0200952{col 37}{space 1}   25.06{col 46}{space 3}0.000{col 54}{space 4}  .464121{col 67}{space 3} .5429302
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}-8.060957{col 26}{space 2} .4158247{col 37}{space 1}  -19.39{col 46}{space 3}0.000{col 54}{space 4}-8.876345{col 67}{space 3}-7.245569
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. reghdfe lnP lngdpo lngdpd if y>=1965 & y<=2006, absorb(id y) vce(robust)
{res}{txt}(dropped 1203 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 7 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}    67,244
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res}  62761{txt}){col 67}= {res}    612.79
{txt}{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.8185
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8056
{txt}{col 51}Within R-sq.{col 67}= {res}    0.0260
{txt}{col 51}Root MSE{col 67}= {res}    0.9529

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}         lnP{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}lngdpo {c |}{col 14}{res}{space 2} .4793204{col 26}{space 2} .0154029{col 37}{space 1}   31.12{col 46}{space 3}0.000{col 54}{space 4} .4491307{col 67}{space 3}   .50951
{txt}{space 6}lngdpd {c |}{col 14}{res}{space 2} .2710232{col 26}{space 2} .0171973{col 37}{space 1}   15.76{col 46}{space 3}0.000{col 54}{space 4} .2373165{col 67}{space 3} .3047299
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} -6.29401{col 26}{space 2} .2689464{col 37}{space 1}  -23.40{col 46}{space 3}0.000{col 54}{space 4}-6.821146{col 67}{space 3}-5.766875
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}          id{col 14}{c |}{space 1}     4440{col 27}{space 1}        0{col 39}{result}{space 1}     4440{col 53}{text} {col 54}{c |}
{res}{col 1}{text}           y{col 14}{c |}{space 1}       42{col 27}{space 1}        1{col 39}{result}{space 1}       41{col 53}{text} {col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. 
. reg lnT lndist lngdpo lngdpd if y==2000, vce(robust)

{txt}Linear regression                               Number of obs     = {res}    19,997
                                                {txt}F(3, 19993)       =  {res} 12882.67
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.6356
                                                {txt}Root MSE          =    {res} 2.3425

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}         lnT{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}lndist {c |}{col 14}{res}{space 2}-1.472611{col 26}{space 2} .0193433{col 37}{space 1}  -76.13{col 46}{space 3}0.000{col 54}{space 4}-1.510525{col 67}{space 3}-1.434697
{txt}{space 6}lngdpo {c |}{col 14}{res}{space 2} 1.161225{col 26}{space 2} .0074553{col 37}{space 1}  155.76{col 46}{space 3}0.000{col 54}{space 4} 1.146612{col 67}{space 3} 1.175838
{txt}{space 6}lngdpd {c |}{col 14}{res}{space 2} .9215594{col 26}{space 2} .0071262{col 37}{space 1}  129.32{col 46}{space 3}0.000{col 54}{space 4} .9075916{col 67}{space 3} .9355273
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}-7.689504{col 26}{space 2} .2031938{col 37}{space 1}  -37.84{col 46}{space 3}0.000{col 54}{space 4} -8.08778{col 67}{space 3}-7.291227
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. reghdfe lnT lngdpo lngdpd if y>=1965 & y<=2006, absorb(id y) vce(robust)
{res}{txt}(dropped 1721 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 7 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}   566,892
{txt}Absorbing 2 HDFE groups{col 51}F({res}   2{txt},{res} 540140{txt}){col 67}= {res}  10690.05
{txt}{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.8384
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8304
{txt}{col 51}Within R-sq.{col 67}= {res}    0.0481
{txt}{col 51}Root MSE{col 67}= {res}    1.4725

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}         lnT{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}lngdpo {c |}{col 14}{res}{space 2} .7317076{col 26}{space 2} .0069782{col 37}{space 1}  104.86{col 46}{space 3}0.000{col 54}{space 4} .7180305{col 67}{space 3} .7453847
{txt}{space 6}lngdpd {c |}{col 14}{res}{space 2} .6500728{col 26}{space 2} .0064107{col 37}{space 1}  101.40{col 46}{space 3}0.000{col 54}{space 4} .6375081{col 67}{space 3} .6626375
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}-12.74763{col 26}{space 2} .0933061{col 37}{space 1} -136.62{col 46}{space 3}0.000{col 54}{space 4} -12.9305{col 67}{space 3}-12.56475
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}          id{col 14}{c |}{space 1}    26709{col 27}{space 1}        0{col 39}{result}{space 1}    26709{col 53}{text} {col 54}{c |}
{res}{col 1}{text}           y{col 14}{c |}{space 1}       42{col 27}{space 1}        1{col 39}{result}{space 1}       41{col 53}{text} {col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. 
. reg lnP lnT if y==2000, vce(robust)

{txt}Linear regression                               Number of obs     = {res}     2,647
                                                {txt}F(1, 2645)        =  {res}   893.24
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.3352
                                                {txt}Root MSE          =    {res}  1.757

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}         lnP{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 9}lnT {c |}{col 14}{res}{space 2} .4208842{col 26}{space 2} .0140824{col 37}{space 1}   29.89{col 46}{space 3}0.000{col 54}{space 4} .3932705{col 67}{space 3} .4484979
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .1839555{col 26}{space 2} .0717523{col 37}{space 1}    2.56{col 46}{space 3}0.010{col 54}{space 4} .0432592{col 67}{space 3} .3246518
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. reghdfe lnP lnT if y>=1965 & y<=2006, absorb(id y) vce(robust)
{res}{txt}(dropped 1153 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 7 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}    68,262
{txt}Absorbing 2 HDFE groups{col 51}F({res}   1{txt},{res}  63752{txt}){col 67}= {res}    779.44
{txt}{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.8155
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8024
{txt}{col 51}Within R-sq.{col 67}= {res}    0.0131
{txt}{col 51}Root MSE{col 67}= {res}    0.9567

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}         lnP{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 9}lnT {c |}{col 14}{res}{space 2} .1396871{col 26}{space 2} .0050034{col 37}{space 1}   27.92{col 46}{space 3}0.000{col 54}{space 4} .1298805{col 67}{space 3} .1494938
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 1.743197{col 26}{space 2} .0256068{col 37}{space 1}   68.08{col 46}{space 3}0.000{col 54}{space 4} 1.693008{col 67}{space 3} 1.793386
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}          id{col 14}{c |}{space 1}     4468{col 27}{space 1}        0{col 39}{result}{space 1}     4468{col 53}{text} {col 54}{c |}
{res}{col 1}{text}           y{col 14}{c |}{space 1}       42{col 27}{space 1}        1{col 39}{result}{space 1}       41{col 53}{text} {col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
{res}{txt}
{com}. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/fcoell/Dropbox/PATSTAT/DATA/../logs/Appendix_Fig7_Table9.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}22 Jun 2020, 11:31:20
{txt}{.-}
{smcl}
{txt}{sf}{ul off}